﻿<Page x:Class="SeaSharpTestApp.MainPage"
      x:Name="mainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:xamlFx="using:XamlFx"
      mc:Ignorable="d">
    <Grid Background="#FFD4D4D4">
      <Grid.ColumnDefinitions>
         <ColumnDefinition Width="*" />
         <ColumnDefinition Width="*" />
      </Grid.ColumnDefinitions>

      <StackPanel Grid.Column="0" Orientation="Vertical" Margin="0,50,0,0"
                    HorizontalAlignment="Center">
         <TextBlock Text="This blur effect" FontSize="25" Margin="0,0,0,20" />
         <TextBlock Text="Render Strategy" />
         <ComboBox x:Name="renderStrategy" />
         <xamlFx:ShaderContentControl EffectRenderStrategy="{Binding SelectedValue, ElementName=renderStrategy}"
                                         HorizontalAlignment="Left"
                                         HorizontalContentAlignment="Stretch"
                                         VerticalAlignment="Stretch">
            <xamlFx:ShaderContentControl.Effect>
               <xamlFx:BlurEffect Radius="{Binding Value, ElementName=blurSlider}" />
            </xamlFx:ShaderContentControl.Effect>
            <Button Content="BUTTON"
                        Width="300"
                        Height="300"
                        BorderThickness="4">
               <Button.Background>
                  <LinearGradientBrush EndPoint="0.5,1"
                                             StartPoint="0.5,0">
                     <GradientStop Color="#FF01496E"
                                          Offset="0" />
                     <GradientStop Color="#FF00A8FF"
                                          Offset="1" />
                  </LinearGradientBrush>
               </Button.Background>
            </Button>
         </xamlFx:ShaderContentControl>
         <TextBlock Text="Blur" />
         <Slider Minimum="0"
                    Maximum="80"
                    x:Name="blurSlider"
                    SmallChange="1.0"
                    LargeChange="1.0"
                    StepFrequency="0.1" />
      </StackPanel>
      <StackPanel Grid.Column="1"
                  Orientation="Vertical" Margin="0,50,0,0"
                  HorizontalAlignment="Center">
         <TextBlock Text="This shadow effect" FontSize="25" Margin="0,0,0,20" />
            <xamlFx:ShaderContentControl HorizontalAlignment="Left"
                                         HorizontalContentAlignment="Stretch"
                                         EffectRenderStrategy="{Binding SelectedValue, ElementName=renderStrategy}"
                                         VerticalAlignment="Stretch">
                <xamlFx:ShaderContentControl.Effect>
                  <xamlFx:DropShadowEffect Radius="{Binding Value, ElementName=shadowRadiusSlider}"
                                           ShadowDepth="{Binding Value, ElementName=shadowDistanceSlider}"
                                           Direction="{Binding Value, ElementName=shadowDirectionSlider}"
                                           ShadowColor="{Binding ShadowColor, ElementName=mainPage}"/>
                </xamlFx:ShaderContentControl.Effect>
                <StackPanel>
                    <TextBlock Text="This is text."
                               FontSize="50"
                               FontWeight="Bold" />
                    <DatePicker HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch" />
                </StackPanel>
            </xamlFx:ShaderContentControl>
         <TextBlock Text="Radius" Margin="0,50,0,0" />
         <Slider Minimum="0"
                 Maximum="50"
                 StepFrequency="0.5"
                 x:Name="shadowRadiusSlider"
                 SmallChange="1.0"
                 LargeChange="1.0" />
         <TextBlock Text="Shadow depth" />
         <Slider Minimum="0"
                    Maximum="300"
                    x:Name="shadowDistanceSlider"
                    SmallChange="1.0"
                    StepFrequency="0.1"
                    LargeChange="1.0" />
         <TextBlock Text="Angle" />
         <Slider Minimum="0"
                    Maximum="720"
                    StepFrequency="0.1"
                    x:Name="shadowDirectionSlider"
                    SmallChange="0.01"
                    LargeChange="0.05" />
         
         <TextBlock Text="Red" />
         <Slider Minimum="0" Maximum="255" StepFrequency="1" SmallChange="1" LargeChange="5" x:Name="sliderR" />
         <TextBlock Text="Green" />
         <Slider Minimum="0" Maximum="255" StepFrequency="1" SmallChange="1" LargeChange="5" x:Name="sliderG" />
         <TextBlock Text="Blue" />
         <Slider Minimum="0" Maximum="255" StepFrequency="1" SmallChange="1" LargeChange="5" x:Name="sliderB" />
      </StackPanel>
    </Grid>
</Page>
